require(['./config'], () => {
    require(["template", 'jquery', 'header', 'footer'], (template) => {
        class Index {
            constructor() {
                this.init()
            }
            init() {
                let select = [
                    "遮瑕",
                    "眉笔",
                    "眼线",
                    "唇釉",
                    "眼影",
                    "气垫",
                ]
                // const id=location.search.slice(4)
                for (let i = 0; i < select.length; i++) {
                    $.get('http://www.xiongmaoyouxuan.com/api/search', {
                        word:select[i],
                        start: 0,
                        sort: 0,
                        couponOnly: NaN,
                        minPrice: 0,
                        maxPrice: 99999
                    }, (resp) => {
                        if (resp.code == 200) {
                            console.log(resp);
                            const {list} = resp.data
                            $('#list-list'+i).html(template("list-list-template", {
                                list: list.slice(0, 3),
                                select:select[i]
                            }))
                        }
                    })
                }
            }
        }
        new Index()
    })
})